<!-- 认证管理 -->
<template>
	<view class="page">
		<view v-if="item.realNameType == 2 || item.businessCardType == 2 || item.badgeType == 2">
		<view class="title">
			我已完成的认证
		</view>
		<view class="list flex flex-wrap">
			<view class="item flex justify-center align-center flex-column" v-if="item.realNameType == 2">
				<view class="icon">
					<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/certification/certification1.png" mode=""></image>
				</view>
				<view class="text flex justify-center align-center">
					实名认证
				</view>
			</view>
			<view class="item flex justify-center align-center flex-column" v-if="item.businessCardType == 2">
				<view class="icon">
					<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/certification/certification2.png" mode=""></image>
				</view>
				<view class="text flex justify-center align-center">
					工牌认证
				</view>
			</view>
			<view class="item flex justify-center align-center flex-column" v-if="item.badgeType == 2">
				<view class="icon">
					<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/certification/certification3.png" mode=""></image>
				</view>
				<view class="text flex justify-center align-center">
					名片认证
				</view>
			</view>
		</view>
		</view>
		<view v-if="item.realNameType != 2 || item.businessCardType != 2 || item.badgeType != 2">
		<view class="title">
			我未完成的认证
		</view>
		<view class="list1 flex flex-wrap">
			<view class="item flex justify-center align-center flex-column" v-if="item.realNameType == 0" @click="link(0)">
				<view class="icon">
					<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/certification/%E5%AE%9E%E5%90%8D%E8%AE%A4%E8%AF%81.png" mode=""></image>
				</view>
				<view class="text flex justify-center align-center">
					实名认证
				</view>
				<view class="link flex justify-center align-center">
					去认证
				</view>
			</view>
			<view class="item flex justify-center align-center flex-column" v-if="item.realNameType == 1">
				<view class="icon">
					<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/certification/%E5%AE%9E%E5%90%8D%E8%AE%A4%E8%AF%81.png" mode=""></image>
				</view>
				<view class="text flex justify-center align-center">
					实名认证
				</view>
				<view class="link flex justify-center align-center">
					认证中...
				</view>
			</view>
			<view class="item flex justify-center align-center flex-column" v-if="item.businessCardType == 0" @click="link(1)">
				<view class="icon">
					<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/certification/%E5%B7%A5%E7%89%8C%E8%AE%A4%E8%AF%81.png" mode=""></image>
				</view>
				<view class="text flex justify-center align-center">
					工牌认证
				</view>
				<view class="link flex justify-center align-center">
					去认证
				</view>
			</view>
			<view class="item flex justify-center align-center flex-column" v-if="item.businessCardType == 1">
				<view class="icon">
					<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/certification/%E5%B7%A5%E7%89%8C%E8%AE%A4%E8%AF%81.png" mode=""></image>
				</view>
				<view class="text flex justify-center align-center">
					工牌认证
				</view>
				<view class="link flex justify-center align-center">
					认证中...
				</view>
			</view>
			<view class="item flex justify-center align-center flex-column" v-if="item.badgeType == 0" @click="link(2)">
				<view class="icon">
					<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/certification/%E5%90%8D%E7%89%87%E8%AE%A4%E8%AF%81.png" mode=""></image>
				</view>
				<view class="text flex justify-center align-center">
					名片认证
				</view>
				<view class="link flex justify-center align-center">
					去认证
				</view>
			</view>
			<view class="item flex justify-center align-center flex-column" v-if="item.badgeType == 1">
				<view class="icon">
					<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/certification/%E5%90%8D%E7%89%87%E8%AE%A4%E8%AF%81.png" mode=""></image>
				</view>
				<view class="text flex justify-center align-center">
					名片认证
				</view>
				<view class="link flex justify-center align-center">
					认证中...
				</view>
			</view>
		</view>
		</view>
	</view>
</template>

<script>
	import { unfinished, completed } from '@/data/certificationAdministration.js'
	export default {
		data() {
			return {
				completed,
				unfinished,
				item:''
			}
		},
		onShow() {
			this.getdata()
		},
		methods: {
			async getdata(){
				let {data: item} = await this.$get('/user/userAuthenticationType')
				console.log(item)
				this.item = item
			},
			link(id) {
				uni.navigateTo({
					url: '/pagesB/renZheng/renzheng?id=' + id
				})
			}
		}
	}
</script>

<style lang="scss">
.page{
	background: #f5f5f5;
	padding: 40rpx 30rpx 0;
	min-height: 100vh;
	.title{
		font-weight: bold;
		color: #333333;
		font-size: 32rpx;
	}
	.list1{
		margin: 30rpx 0 40rpx;
		background: #FFFFFF;
		border-radius: 24px;
		padding: 40rpx 0 10rpx;
		.item{
			width: 33.33%;
			margin-bottom: 30rpx;
			.icon{
				width: 100rpx;
				height: 100rpx;
			}
			.text{
				color: #333333;
				font-size: 28rpx;
				margin-top: 20rpx;
			}
			.link{
				font-size: 24rpx;
				text-decoration: none;
				color: #999999;
			}
		}
	}
	.list{
		margin: 30rpx 0 40rpx;
		background: #FFFFFF;
		border-radius: 24px;
		padding: 40rpx 0 10rpx;
		min-height: 278rpx;
		.item{
			width: 33.33%;
			margin-bottom: 30rpx;
			.icon{
				width: 100rpx;
				height: 100rpx;
			}
			.text{
				color: #333333;
				font-size: 28rpx;
				margin-top: 20rpx;
			}
			.link{
				font-size: 24rpx;
				text-decoration: underline;
				color: #999999;
			}
		}
	}
}
</style>
